/*
 * KKEventAction.h
 *
 *  Created on: 2013-9-15
 *      Author: wanghua
 */

#ifndef KKEVENTACTION_H_
#define KKEVENTACTION_H_

#include "kaka_common.h"

#include "KKTouch.h"

class KKNode;

class KKEventActionArgs {
	;CC_SYNTHESIZE(KKNode*,m_source,Source)
	;CC_SYNTHESIZE(KKTouch*,m_touch,Touch)
	;CC_SYNTHESIZE(CCPoint*,m_scroll,Scroll)
	;CC_SYNTHESIZE(CCPoint*,m_velocity,Velocity)
	;CC_SYNTHESIZE(CCPoint*,m_zoom,Zoom)
	;CC_SYNTHESIZE(float,m_rotate,Rotate)
	;CC_SYNTHESIZE(void*,m_data,Data)
	;CC_SYNTHESIZE(KKPropertiesDictionary*,m_args,Args)
	;

public:
	KKEventActionArgs() :
			m_source(NULL), m_touch(NULL), m_scroll(NULL), m_velocity(NULL), m_zoom(
			NULL), m_rotate(0), m_data(NULL), m_args(NULL) {

	}
	;
};

class KKEventAction: public cocos2d::CCObject {
private:
	;CC_SYNTHESIZE(const char*,m_action,Action)
	;CC_SYNTHESIZE(const char*,m_target,Target)
	;CC_SYNTHESIZE(int,m_targetId,TargetId)
	;CC_SYNTHESIZE(ActionType,m_actionType,ActionType)
	;CC_SYNTHESIZE(TargetType,m_targetType,TargetType)
	;CC_SYNTHESIZE_READONLY(KKPropertiesDictionary*,m_args,Args)
	;

public:
	KKEventAction();
	virtual ~KKEventAction();

	static KKEventAction* actionWithXml(TiXmlElement* element);

	bool initWithXml(TiXmlElement* element);

	void run(KKEventActionArgs* args);

	bool getBooleanArg(string key);
	int getIntArg(string key);
	float getFloatArg(string key);
	string getStringArg(string key);
};

#endif /* KKEVENTACTION_H_ */
